
<div class="pagination">
    <ul class="">
        <?php if ($pager->haveToPaginate()): ?>
            <?php
            $paramtersHolder = array();
            foreach ($sf_request->getGetParameters() as $k => $v)
            {
                if (is_object($v))
                {
                    $array = array();
                    foreach ($v as $k1 => $v1)
                    {
                        $array[$k1]          = $v1;
                    }
                    $v                   = $array;
                }
                $paramtersHolder[$k] = $v;
            }
            ?>
            <?php if ($pager->isFirstPage()) : ?>
                <li class="previous-off"><a href="javascript:void(0)"> » </a> </li>
                <li class="previous-off"><a href="javascript:void(0)"> <?php echo __('Previous') ?> </a> </li>
            <?php else: ?>
                <li class="previous"><a href="<?php echo url_for($routeName, array_merge($paramtersHolder, array('page' => 1))) ?>" title="<?php echo __('first page') ?>"> » </a> </li>
                <li class="previous"><a href="<?php echo url_for($routeName, array_merge($paramtersHolder, array('page' => $pager->getPreviousPage()))) ?>" title="<?php echo __('previous page') ?>" ><?php echo __('Previous') ?>  </a> </li>
            <?php endif; ?>
            <?php foreach ($pager->getLinks() as $page): ?>
                <?php if ($page == $pager->getPage()): ?>
                    <li class="active"><a href="javascript:void(0)"> <?php echo $page ?></a></li>
                <?php else: ?>
                    <li><a href="<?php echo url_for($routeName, array_merge($paramtersHolder, array('page' => $page))) ?>" class="next"><?php echo $page ?></a></li>
                <?php endif; ?>
            <?php endforeach; ?>
            <?php if ($pager->isLastPage()) : ?>
                <li class="next-off"><a href="javascript:void(0)">  <?php echo __('Next') ?></a> </li>
                <li class="next-off"><a href="javascript:void(0)">  « </a></li>
            <?php else: ?> 
                <li class="next"><a href="<?php echo url_for($routeName, array_merge($paramtersHolder, array('page' => $pager->getNextPage()))) ?>" title="<?php echo __('next page') ?>"> <?php echo __('Next') ?> </a></li>
                <li class="next"><a href="<?php echo url_for($routeName, array_merge($paramtersHolder, array('page' => $pager->getLastPage()))) ?>" title="<?php echo __('last page') ?>"> « </a></li>
            <?php endif; ?>
        <?php else: ?>
            <li class="previous-off"><span> » </span></li>
            <li class="previous-off"><span> <?php echo __('Previous') ?></span> </li>
            <li class="active"><span>1</span></li>
            <li class="next-off"><span> <?php echo __('Next') ?></span> </li>
            <li class="next-off "><span> « </span></li>
        <?php endif; ?>
    </ul>
</div>
